﻿<%@ Page Language="C#" MasterPageFile="~/Back/BackgroundMain.master" AutoEventWireup="true"
    CodeFile="FileList.aspx.cs" Inherits="Back_FileList" Title="下载文件管理页面" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">

    <script type="text/javascript">
       // var selNum = 0;           
        function AddSelValues(oChk)  
        { 
            var iphdn = document.getElementById("ctl00_ContentPlaceHolder1_ipt_HdnSelectedValues");                 
            if(oChk.checked)
            {
            //    selNum++;
                iphdn.value += "," + oChk.value; 
            }
            else
            {
              iphdn.value = iphdn.value.replace("," + oChk.value,""); 
            }
        }

    </script>

    <%--
    <asp:ScriptManager runat="server" ID="Script1">
    </asp:ScriptManager>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>    --%>
    <input id="ipt_HdnSelectedValues" type="hidden" name="HdnSelectedValues" runat="server" />
    <div class="centertop" id="dvNav" runat="server">
        当前位置：<a href="BgArticleList.aspx">中共重庆市沙坪坝区委统一战线工作部</a>&nbsp;&gt;&gt;&nbsp;<a href="FileList.aspx">下载文件管理</a>
    </div>
    <div style="text-align: center; margin: auto; float:left; padding-left:20px">
        <asp:GridView ID="gvDict" runat="server" AllowPaging="True" AutoGenerateColumns="False"
            Width="650px" CellPadding="4" ForeColor="#333333" HorizontalAlign="Left" GridLines="None"
            OnPageIndexChanging="gvDict_PageIndexChanging" OnRowDataBound="gvDict_RowDataBound"
            OnRowCommand="gvDict_RowCommand">
            <EmptyDataTemplate>
                暂时没有您需要的数据!
            </EmptyDataTemplate>
            <Columns>
                <asp:TemplateField>
                    <ItemTemplate>
                        <asp:Label ID="lbl_ID" runat="server" Text='<%#Eval("ID")%>' Visible="false"></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="文件名">
                    <HeaderStyle HorizontalAlign="Left" />
                    <ItemStyle Width="300px" HorizontalAlign="left" />
                    <ItemTemplate>
                        <%#Eval("Title")%>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="ViewTimes" HeaderText="下载次数" />
                <asp:TemplateField HeaderText="是否显示">
                    <HeaderStyle HorizontalAlign="center" Width="60px" />
                    <ItemStyle HorizontalAlign="center" />
                    <ItemTemplate>
                        <input type="checkbox" runat="server" id="IsDisplayCheckBox" onclick="AddSelValues(this)"
                            value='<%#DataBinder.Eval(Container.DataItem,"ID")%>' />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="操作">
                    <HeaderStyle Width="60px" />
                    <ItemTemplate>
                        <asp:LinkButton ID="lnkDownload" runat="server" CommandArgument='<%# Eval("ID") %>'
                            CommandName="Download" Text="下载"></asp:LinkButton>
                        <asp:LinkButton ID="lnkbDelete" runat="server" CommandArgument='<%# Eval("ID") %>'
                            CommandName="DeleteContent" OnClientClick="return confirm('是否删除这个文件?')" Text="删除"></asp:LinkButton>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
            <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
            <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
            <EditRowStyle BackColor="#2461BF" />
            <AlternatingRowStyle BackColor="White" />
        </asp:GridView>
    </div>
    <div style="text-align:left;padding-left:20px">
        <asp:Button ID="btn_sumit" runat="server" Text="提交" OnClick="btn_sumit_Click" CssClass="button" />
        <asp:Button ID="btn_Add" runat="server" PostBackUrl="~/Back/FileAdd.aspx" Text="添加文件"
            CssClass="button" />
    </div>
    <%--  </ContentTemplate>
    </asp:UpdatePanel>--%>
</asp:Content>
